#include<iostream>
#include<string>
#include<regex>
using namespace std;

int main(){
    string s = "你好";
    regex reg(s.c_str());
    string str1("你好，世界，你好，世界");
    str1 = regex_replace(str1, reg, ("\033[1;34m" + s + "\033[0m"),
                            regex_constants::format_first_only);
    string str2("你好，你好，你好");
    str2 = regex_replace(str2, reg, ("\033[1;31m" + s + "\033[0m"));
    cout << "after : " << str1 << endl;
    cout << "after : " << str2 << endl;
    return 0;
}

//\033[1;34m%s\033[0m